package com.huage_10.lesson_02;

public class ReflectDemo {
    public static void main(String[] args) throws ClassNotFoundException {
        //使用类的Class属性
        Class<Student> c1 = Student.class;
        System.out.println(c1);

        //调用对象的getClass()方法
        Student student = new Student();
        Class<? extends Student> c2 = student.getClass();
        System.out.println(c2 == c1);

        //使用Class类中的静态方法forName
        Class<?> c3 = Class.forName("com.huage_10.lesson_02.Student");
        System.out.println(c3 == c1);
    }
}
